<template>
  <el-container style="height: 100vh" class="full-screen-container">
    <el-header>
      <div class="header-title">管理系统</div>
      <el-dropdown>
        <span class="el-dropdown-link">
          当前登录用户<el-icon class="el-icon--right"><arrow-down /></el-icon>
        </span>
        <template #dropdown>
          <el-dropdown-menu>
            <el-dropdown-item :icon="UserFilled">个人信息</el-dropdown-item>
            <el-dropdown-item :icon="CircleCloseFilled">退出登录</el-dropdown-item>
          </el-dropdown-menu>
        </template>
      </el-dropdown>
    </el-header>
    <el-container>
      <el-aside width="200px">
        <el-menu
            default-active="$route.path"
            class="sidebar-menu"
            router
        >
          <el-menu-item index="/dashboard">
            <i class="el-icon-house"></i>
            <span>仪表盘</span>
          </el-menu-item>
          <el-menu-item index="/user/list">
            <i class="el-icon-user"></i>
            <span>用户管理</span>
          </el-menu-item>
        </el-menu>
      </el-aside>
      <el-main class="full-screen-main">
        <router-view/>
      </el-main>
    </el-container>
  </el-container>
</template>

<script setup>
// 引入必要的图标
import { ArrowDown, UserFilled, CircleCloseFilled } from '@element-plus/icons-vue';
</script>

<style scoped>
/* 组件特定的样式 */
.el-dropdown-link {
  color: white; /* 设置文字颜色为白色 */
  text-decoration: none; /* 可选：去除下划线 */
}

.el-dropdown-link .el-icon--right {
  transition: border-color 0.3s ease;
  padding: 0; /* 移除边框 padding */
}

.el-dropdown-link .el-icon--right:hover {
  border-color: transparent;
}

.sidebar-menu {
  height: 100%;
  background-color: #000; /* 恢复背景色为黑色 */
  color: #fff; /* 恢复文字颜色为白色 */
}

.sidebar-menu .el-menu-item {
  background-color: #000; /* 设置菜单项背景颜色为黑色 */
  color: #fff; /* 设置菜单项文字颜色为白色 */
}

.sidebar-menu .el-menu-item:hover {
  background-color: #333; /* 设置菜单项悬停时的背景颜色 */
}

.header-title {
  font-size: 18px;
  font-weight: bold;
  color: #fff;
}

.el-header {
  background-color: #000;
  box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.1);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
}
.full-screen-main {
  background-color: #f5f7fa;
  padding: 0;
  margin: 0;
}
.full-screen-container {
  margin: 0;
  padding: 0;
  height: 100vh;
}
</style>
